﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace TaxSetup
{
    /// <summary>
    /// Interaction logic for DialogTaxClassList.xaml
    /// </summary>
    public partial class DialogTaxClassList : Window
    {
        private SalesManagerEntities _context;
        public tblTaxClass TaxClass = null;
        private CollectionViewSource _taxClassesViewSource;

        public DialogTaxClassList(SalesManagerEntities context)
        {
            _context = context;
            InitializeComponent();
        }

        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            TaxClass = (tblTaxClass)_taxClassesViewSource.View.CurrentItem;
            DialogResult = true;
            Close();
        }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _taxClassesViewSource = (CollectionViewSource)Resources["TaxClasses"];
            _taxClassesViewSource.Source = _context.tblTaxClasses;
        }

        private void lstProducts_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {

        }
    }
}
